﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace CommonPay.WePay.XcxPay
{
    public interface IXcxPayApi
    {
        /// <summary>
        /// 接收从微信支付后台发送过来的数据并验证签名
        /// </summary>
        /// <returns></returns>
        Task<XcxPayData> GetNotifyDataAsync();
        /// <summary>
        /// 获取WxSession
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<WxSession> GetWxSessionAsync(string code);
        /// <summary>
        /// 提交被扫支付API
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> MicropayAsync(XcxPayData inputObj, int timeOut = 10);
        /// <summary>
        /// 查询订单
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> OrderQueryAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 撤销订单API接口
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> ReverseAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 申请退款
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> RefundAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 查询退款
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> RefundQuery(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 下载对账单
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> DownloadBillAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 转换短链接
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> ShortUrlAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 统一下单
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> UnifiedOrderAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 统一下单
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> UnifiedOrderAppAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 关闭订单
        /// </summary>
        /// <param name="inputObj"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        Task<XcxPayData> CloseOrderAsync(XcxPayData inputObj, int timeOut = 6);
        /// <summary>
        /// 测速上报接口实现
        /// </summary>
        /// <param name="interface_url"></param>
        /// <param name="timeCost"></param>
        /// <param name="inputObj"></param>
        /// <returns></returns>
        Task<XcxPayData> ReportAsync(XcxPayData inputObj, int timeOut = 1);
    }
}
